'use strict';
/**
 * 创建 文章内容迁移文件
 * 修改表字段属性: https://www.bilibili.com/video/BV1HE42157zV?p=25&spm_id_from=pageDriver&vd_source=ac3d4215a1a74af0ce5df86535d7f5ce
 *
 * @type {import('sequelize-cli').Migration}
 */
/**  */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('Articles', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER.UNSIGNED
      },
      title: {
        type: Sequelize.STRING
      },
      content: {
        type: Sequelize.TEXT
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      }
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('Articles');
  }
};